- /* dpow10.cpp by K.Tsuru */
- /************************************
- It returns 10^n.
- It asumes that |n| has order of 10.
- ************************************/
- double dpow10(const int n){
- if(!n) return 1.0;
- double r(1), z(10.0);
- int m = n>0 ? n : -n;
-
- while(1){
- if( m & 1 ) r *= z;
- m /= 2;
- if( !m ) break;
- z *= z;
- }
- if(n > 0) return r;
- return 1.0/r;
- }
dpow10.cpp : last modifiled at 2017/02/16 21:45:40(388 bytes)
created at 2016/04/11 11:17:20
The creation time of this html file is 2017/10/07 10:54:15 (Sat Oct 07 10:54:15 2017).